<!DOCTYPE html>
<!-- 
	GeoEye Keynote Presentation Demonstration
	2011 Google Geospatial Awareness Day
	
	By: Alan Poole and Deke Young, GeoEye
	Date: August 24, 2011
 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>Vail, CO Introduction Slide, 2011 Google Geospatial
	Awarness Day, GeoEye Keynote</title>
<script type="text/javascript"
	src="https://www.google.com/jsapi?key=ABQIAAAAMHzgPJvXPnl2p4bABkaCXhRimGqiYhdLemnilBW33CtvBu9uoxSq4N6qXZDmAg_SFP6A3nX6sZqFPg">
	
</script>
<script type="text/javascript">
	var ge = null;

	// Vail, CO Latitude/Longitude
	var latitude = 39.549731;
	var longitude = -106.214415;

	// load the Google Earth API
	google.load("earth", "1");

	// initialization function once Google Earth API is loaded
	function initGlobe() {
		// create an instance of the Google Earth API in the map3d div
		// call the initCallback once loading is succsessfull
		// call the failureCallback if there is an issue
		google.earth.createInstance("map3d", initCallback, failureCallback);
	}

	// function called once the Google Earth API instance is successfully loaded
	function initCallback(object) {
		// capture the Google Earth API instance and set the ge variable for later use
		ge = object;

		// set the visibility of the earth to true
		ge.getWindow().setVisibility(true);

		// add the default/auto navigation controls
		ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);

		// add some default layers for navigation purposes
		ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
		ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
		ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, true);

		// Create the placemark and set its name
		var placemark = ge.createPlacemark('');
		placemark.setName("Vail Pass, Colorado, USA");

		// Set the placemark's location.  
		var point = ge.createPoint('');
		point.setLatitude(latitude);
		point.setLongitude(longitude);
		placemark.setGeometry(point);

		// Add the placemark to Earth instance
		ge.getFeatures().appendChild(placemark);

		// Get the current view, relative to the ground
		var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);

		// tilt the look at angle a bit and zoom into specific meters
		lookAt.setTilt(lookAt.getTilt() + 50.0);
		lookAt.setLatitude(latitude);
		lookAt.setLongitude(longitude);
		lookAt.setRange(8665); //meters

		// Update the view in Google Earth
		ge.getView().setAbstractView(lookAt);
	}

	// function called if there is an error creating the Google Earth instance
	function failureCallback(object) {
		// alert the user that there is an issue loading the globe
		alert("Google Earth globe could not be loaded.");
	}

	// add the initialize globe function to the on page load
	window.onload = initGlobe;
</script>
</head>

<body style="height: 100%; margin: 0; padding: 0;">
	<div id="map3d"
		style="border: 1px solid silver; height: 100%; width: 100%"></div>
</body>
</html>